package com.vincce.fitness.mappers.mgt;
import com.vincce.fitness.core.base.MyBatisRepository;
import com.vincce.fitness.entity.Admin;
import com.vincce.fitness.entity.Page;
import com.vincce.fitness.entity.Role;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: lenovo
 * Date: 13-4-16
 * Time: 下午5:38
 */
@MyBatisRepository
public interface RoleMapper {
	/**用户拥有的角色 **/
	public List<Role> findRoleByAdminId(Integer adminId);




	/**获取所有角色**/
	public List<Role> getAllRoles(Admin admin);





    /**获取所有角色**/
    public List<Role> getAllRole();
    /**根据userId获取用户角色**/
	public List<Role> findAllRole(Integer adminId);
	/**获取所有角色具有分页条件**/
	public List<Role> getAllRole(Page<Role> page);
	/**获取所有角色数量**/
	public long getAllRoleCount(Page<Role> page);

	public void addRole(Role role);
	/**添加角色资源**/
	public void addRoleResource(Map<String, Integer> map);



	public void updateRole(Role role);

    public void deleteRole(Integer roleId);

	public void deleteReoRes(Integer roleId);

	/**根据名称获取角色id**/
	public Integer findRoleByName(String trim);

    public List<Integer> findRoleId(Integer adminId);







    public Integer findMaxId();
    public void addRoleInfo(Role role);
    public void updateRoleInfo(Role role);

    public Integer findLcId(Map<String, Integer> map);

    public void deleteAdminRole(Integer roleId);

}
